//
//  JFTDateFormatter.m
//  JFTBusiness
//
//  Created by mac on 2017/9/5.
//  Copyright © 2017年 junHaoPay. All rights reserved.
//

#import "JFTDateFormatter.h"

@implementation JFTDateFormatter
+ (NSString *)getDateStrDate:(NSDate*)date dateFormatter:(NSString*)formatters{
    NSMutableDictionary *threadDict =[[NSThread currentThread] threadDictionary];
    NSDateFormatter*dateFormatter =threadDict[@"myDateFormatter"];
    if (!dateFormatter) {
        @synchronized (self) {
            if (!dateFormatter) {
                dateFormatter =[[NSDateFormatter alloc]init];
                [dateFormatter setLocale:[NSLocale currentLocale]];
                [dateFormatter setDateFormat:formatters];
                threadDict[@"myDateFormatter"] =dateFormatter;
            }
        }
    }
    NSString *conversationDateString =[dateFormatter stringFromDate:date];
    return conversationDateString;
}
@end
